<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Ibator Generated Java DAO Classes</title>
  <link type="text/css" rel="stylesheet" href="../ibator.css"/>
</head>
<body>

<div class="menuNav">
  <p>
    <a href="../index.html" target="_top">Show Menu</a>
    <a href="javadao.html" target="_top">Hide Menu</a>
  </p>
</div>

<h1>Ibator Generated Java DAO Classes</h1>
<p>Ibator generates DAO classes of several types.  For each table in the configuration, Ibator
generates a Java Interface that describes DAO methods, and a Java Class that implements the
generated interface.  Generating DAO objects is optional, and is controlled by the
<code>&lt;daoGenerator&gt;</code> configuration element.  Ibator can generate DAOs of the following
types:
</p>
<ul>
  <li>IBATIS - for use with the iBATIS DAO Framework</li>
  <li>SPRING - for use with the Spring Framework</li>
  <li>GENERIC-CI - with no dependencies beyond the iBATIS Data Mapper</li>
  <li>GENERIC-SI - also with no dependencies beyond the iBATIS Data Mapper</li>
</ul>

<p>Every field and method generated by Ibator includes the non-standard JavaDoc tag
<code>@ibatorgenerated</code>.  On subsequent runs of Ibator, every field and method that
includes this JavaDoc tag will be deleted and replaced.  Any other field or method in the
class will be untouched by Ibator.
With this in mind, you can add other fields and methods to the classes without fear of losing them in
subsequent runs of Ibator - simply DO NOT include the <code>@ibatorgenerated</code>
JavaDoc tag on anything that you add to the class.</p>

<p>Note: in the following descriptions, the term "BLOB" is used to refer to any column
with a data type of BLOB, CLOB, LONGVARCHAR, or LONGVARBINARY.</p>

<h2>Methods Common to All DAO Types</h2>
<p>Depending on the specifics of the table, and the configuration options, the DAO generator
will generate these methods:</p>
<ul>
  <li>countByExample</li>
  <li>deleteByPrimaryKey</li>
  <li>deleteByExample</li>
  <li>insert</li>
  <li>insertSelective</li>
  <li>selectByPrimaryKey</li>
  <li>selectByExample</li>
  <li>selectByExampleWithBLOBs</li>
  <li>updateByPrimaryKey (with an override to specify whether or not to update BLOB columns)</li>
  <li>updateByPrimaryKeySelective (will only update non-null fields in the parameter class)</li>
  <li>updateByExample (with an override to specify whether or not to update BLOB columns)</li>
  <li>updateByExampleSelective (will only update non-null fields in the parameter class)</li>
</ul>
<p>Ibator attempts to make it easier to deal with tables that contain BLOBs by generating
different objects and methods so that you can use the BLOB fields, or ignore them, depending
on the situation.</p>
<p>See the
<a href="exampleClassUsage.html">Example Class Usage</a>
page for an example of using the <code>selectByExample</code> method.</p>

<h2>IBATIS DAOs</h2>
<p>iBATIS DAOs depend on the iBATIS DAO framework (an optional part of iBATIS - now deprecated).
They extend the SqlMapDaoTemplate class and are
constructed with an instance of the DAOManager object, and call methods in their super class
to execute the different statements.</p>
<p>Ibator does not update the "dao.xml" file for you - you must add the appropriate entries
manually.</p>
<p>The iBATIS DAO framework is a very elementary IoC container and can be useful if you
are not already using something like Spring or PicoContainer to manage dependencies.
However, the framework is now deprecated and we suggest that you move to Spring.</p>

<h2>SPRING DAOs</h2>
<p>SPRING DAOs depend on the Spring framework.  They extend Spring's SqlMapClientDaoSupport class,
and are constructed by the Spring container.</p>

<h2>GENERIC-CI DAOs</h2>
<p>GENERIC-CI DAOs call methods in iBATIS' SqlMapClient interface directly.  An instance of the
interface is supplied through constructor injection.</p>

<h2>GENERIC-SI DAOs</h2>
<p>GENERIC-SI DAOs call methods in iBATIS' SqlMapClient interface directly.  An instance of the
interface is supplied through setter injection.</p>

</body>
</html>
